public class Base3Computer {

	
	public static void main(String[] args) {
		
		int x = 5000000;
		displayBase3(x);
	

	}
	
	
	public static void displayBase3(int input)
	{
		if (input!=0) // recursive case
		{
			displayBase3(input/3);
			System.out.print(input%3);
		}		
	}
}